//
//  RoadShowUnexamineCell.m
//  BigToBig
//
//  Created by yi liu on 16/7/25.
//  Copyright © 2016年 cn.cloudtp. All rights reserved.
//

#import "RoadShowUnexamineCell.h"

@interface RoadShowUnexamineCell ()
@property (nonatomic , strong)UIButton *agreeButton;
@property (nonatomic , strong)UIButton *refuseButton;

@end


@implementation RoadShowUnexamineCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
        
    }
    return self;
}

- (void)createSubViews{
    //  头像
    self.headImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, (kScreenWidth - 20)/6, (kScreenWidth - 20)/6)];
    self.headImageView.image = [UIImage imageNamed:@"touxiang"];
    [self addSubview:self.headImageView];
    self.headImageView.layer.cornerRadius = (kScreenWidth - 20)/12;
    self.headImageView.layer.masksToBounds = YES;
    
    
    // 标题
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.headImageView.maxX + 10, self.headImageView.y + 5, kScreenWidth - self.headImageView.maxX - 10, self.headImageView.height /3)];
    [self addSubview:self.titleLabel];
    self.titleLabel.textAlignment = UITextAlignmentLeft;
    
    // 描述
    self.describeLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.titleLabel.x, self.titleLabel.maxY , self.titleLabel.width, self.height - self.titleLabel.maxY)];
    [self addSubview:self.describeLabel];
    self.describeLabel.numberOfLines = 0;
    self.describeLabel.font = [UIFont systemFontOfSize:12];
    self.describeLabel.textColor = [UIColor lightGrayColor];
    
    // 同意入会button
    self.agreeButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [self.agreeButton setTitle:@"同意" forState:UIControlStateNormal];
    [self.agreeButton setTitleColor:COLOR_RGBA(255, 185, 187, 1) forState:UIControlStateNormal];
    self.agreeButton.layer.borderWidth = 1;
    self.agreeButton.layer.cornerRadius = 5;
    self.agreeButton.layer.masksToBounds = YES;
    self.agreeButton.layer.borderColor = [COLOR_RGBA(255, 185, 187, 1) CGColor];
    [self addSubview:self.agreeButton];
    [self.agreeButton addTarget:self action:@selector(agreeButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    // 拒绝入会button
    self.refuseButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [self.refuseButton setTitle:@"不同意" forState:UIControlStateNormal];
    [self.refuseButton setTitleColor:COLOR_RGBA(187, 187, 187, 1) forState:UIControlStateNormal];
    self.refuseButton.layer.borderWidth = 1;
    self.refuseButton.layer.cornerRadius = 5;
    self.refuseButton.layer.masksToBounds = YES;
    self.refuseButton.layer.borderColor = [COLOR_RGBA(181, 181, 181, 1) CGColor];
    [self addSubview:self.refuseButton];
    [self.refuseButton addTarget:self action:@selector(refuseButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    
}

- (void)agreeButtonAction:(UIButton *)button{
    
}

- (void)refuseButtonAction:(UIButton *)button{
    
}

- (void)layoutSubviews{
    self.describeLabel.frame = CGRectMake(self.titleLabel.x, self.titleLabel.maxY , self.titleLabel.width, self.height - self.titleLabel.maxY - 30);
    self.agreeButton.frame = CGRectMake(kScreenWidth / 4 * 2, self.describeLabel.maxY, kScreenWidth / 4 - 10, self.height - self.describeLabel.maxY - 5);
    self.refuseButton.frame = CGRectMake(kScreenWidth / 4 * 3, self.describeLabel.maxY, kScreenWidth / 4 - 10, self.height - self.describeLabel.maxY - 5);
    
    UILabel *lineLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, self.height - 1, kScreenWidth, 1)];
    lineLabel.backgroundColor = COLOR_RGBA(247, 247, 247, 1);
    [self.contentView addSubview:lineLabel];
}





- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
